# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models
import datetime
import time 
#用户信息表
class Customer(models.Model):
	id = models.AutoField(primary_key=True)
	openid = models.CharField("openid", max_length=120)
	nickname = models.CharField("nickname",max_length=120)
	sex = models.CharField("sex",max_length=1)
	province = models.CharField("province",max_length=60)
	city = models.CharField("city",max_length=60)
	country = models.CharField("country",max_length=60)
	privilege = models.CharField("privilege",max_length=30)
	headimgurl = models.CharField("headimgurl",max_length=255)

#用户登录表,非管理员人员的后台登录
class Login(models.Model):
	id = models.AutoField(primary_key=True)
	openid = models.CharField(verbose_name='ID',max_length=30)
	nickname = models.CharField(verbose_name='nickname', max_length=30)
	#timestamp = models.IntegerField("时间戳",default = int(time.time()))
	logintime = models.CharField("登录时间",max_length=30,default = "0")
	
#记录Token。过期重新申请
class Token(models.Model):
  uniqueid = models.CharField(verbose_name='uniqueid',max_length=60)
  token = models.CharField(verbose_name = 'token',max_length = 255)
  tokentime = models.CharField(verbose_name = 'tokentime',max_length = 30)